/*  This file is part of CASpp.

    CASpp is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.

    CASpp is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with CASpp.  If not, see <http://www.gnu.org/licenses/>.

    Copyright 2014 Jérome LAURENS

    See https://code.google.com/p/idalgo/

*/

#ifndef CASPP_TYPES_H
#define CASPP_TYPES_H

#include <boost/array.hpp>
#include <caspp/config.h>

CASPP_NS_BEGIN

namespace Type {

    enum Unary {
        kUNDEF = 0,
        kAUTO = kUNDEF,
        kBOOL = 1,
        kSTR  = 2,
        kLIST = 3,
        kVECT = 4,
        kSET  = 5,
        kMAP  = 6,
        kINT  = 10,
        kRAT  = 11,
        kREAL = 12,
        kCPLX = 13,
        kROOT = 14,
        kVAR  = 20,
        kSYMB = 21,
        kFUNC = 30,
        kDEFN = 31,
        kMOD  = 211,
        kUSER = 221,
        kEQW  = 231,
        kGFX  = 241,
        kPTR  = 251,
        kEXT  = 261,
        kPOLY = 271,
        kSP1  = 272,
        kCOUNT = 13
    };

    std::string name(const Unary type);

    typedef boost::array<Unary,kCOUNT> Array;

}

// Example:
// CASpp::Type::Array types = {{ CASPP_ALL_NODE_TYPES(CASPP_DO) }};

#define CASPP_ALL_NODE_TYPES(__M) \
__M(kUNDEF),\
__M(kBOOL),\
__M(kSTR ),\
__M(kLIST),\
__M(kVECT),\
__M(kSET ),\
__M(kMAP ),\
__M(kINT ),\
__M(kRAT ),\
__M(kREAL),\
__M(kCPLX),\
__M(kROOT),\
__M(kVAR),\
__M(kSYMB),\
__M(kFUNC)


CASPP_NS_END

#endif // CASPP_TYPES_H
